package main;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class ReadWriteFile {

    public static void writeTextToFile(String texttowrite, String fileadress) {
        try {
            FileWriter fw = new FileWriter(fileadress, false);
            BufferedWriter output = new BufferedWriter(fw);
            output.write(texttowrite);
            output.flush();
            output.close();
        } catch (IOException ioe) {
            System.out.println("error " + ioe);
        }
    }
    ///home/me/Documents/ToWindows/matrix1.txt

    public static void writeTextToFile(Integer[][] tab) {

        String ret = "";
        for (int i = 2 ; i <= WithOutFactorsOutPut.entiermax ; i++) {
            for (int j = 2 ; j <= WithOutFactorsOutPut.entiermax ; j++) {
                ret += tab[i][j] + ",";
            }
            ret += "\n";
        }
        writeTextToFile(ret, "/home/me/Documents/ToWindows/matrix3.txt");
    }

  

   public  static void writeTextToFile(int[] cptResult) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
